]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st: Specify G_PARAM_EXPLICIT_NOTIFY where appropriate
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 9 Feb 2022 12:59:15 +0000 (13:59 +0100)
committerMarge Bot <marge-bot@gnome.org>
Thu, 10 Feb 2022 13:09:37 +0000 (13:09 +0000)
We are now consistently calling notify() when a property does change.

With that we can opt out of g_object_set()'s implicit change notifications,
so that notify is only emitted when a property *actually* changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2168>

15 files changed:
src/st/st-adjustment.c
src/st/st-bin.c
src/st/st-box-layout.c
src/st/st-button.c
src/st/st-entry.c
src/st/st-icon.c
src/st/st-label.c
src/st/st-password-entry.c
src/st/st-scroll-bar.c
src/st/st-scroll-view-fade.c
src/st/st-scroll-view.c
src/st/st-scrollable.c
src/st/st-settings.c
src/st/st-theme-context.c
src/st/st-widget.c

index 28ab78e41b187a0935300231899a1a890ec3960c..d2baa660ee3e2d782d030eb1e7691ca5f89117f7 100644 (file)
@@ -302,7 +302,8 @@ st_adjustment_class_init (StAdjustmentClass *klass)
   props[PROP_ACTOR] =
     g_param_spec_object ("actor", "Actor", "Actor",
                          CLUTTER_TYPE_ACTOR,
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE |
+                         G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StAdjustment:lower:
index e96768626fd72cac8397f98c930ab332f660da3c..9d86ea2336326b678b713871fe377bd758fd4e37 100644 (file)
@@ -312,7 +312,7 @@ st_bin_class_init (StBinClass *klass)
                          "Child",
                          "The child of the Bin",
                          CLUTTER_TYPE_ACTOR,
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   g_object_class_install_properties (gobject_class, N_PROPS, props);
 }
index 269ded4120960f28bf308284ade1ca1b63f22722..990fb9ed6e4c3e3b968b86263529919d69beca5f 100644 (file)
@@ -191,7 +191,7 @@ st_box_layout_class_init (StBoxLayoutClass *klass)
                           "Whether the layout should be vertical, rather"
                           "than horizontal",
                           FALSE,
-                          ST_PARAM_READWRITE);
+                          ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StBoxLayout:pack-start:
index df0148bc690eb851c666f5827bdc35731a574129..0e95bfaf090db110616593cb0a0cdb066974dd76 100644 (file)
@@ -488,7 +488,7 @@ st_button_class_init (StButtonClass *klass)
                          "Label",
                          "Label of the button",
                          NULL,
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StButton:button-mask:
@@ -500,7 +500,7 @@ st_button_class_init (StButtonClass *klass)
                         "Button mask",
                         "Which buttons trigger the 'clicked' signal",
                         ST_TYPE_BUTTON_MASK, ST_BUTTON_ONE,
-                        ST_PARAM_READWRITE);
+                        ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StButton:toggle-mode:
@@ -512,7 +512,7 @@ st_button_class_init (StButtonClass *klass)
                           "Toggle Mode",
                           "Enable or disable toggling",
                           FALSE,
-                          ST_PARAM_READWRITE);
+                          ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StButton:checked:
@@ -528,7 +528,7 @@ st_button_class_init (StButtonClass *klass)
                           "Checked",
                           "Indicates if a toggle button is \"on\" or \"off\"",
                           FALSE,
-                          ST_PARAM_READWRITE);
+                          ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StButton:pressed:
index 3a43504070c669e613007c96e11588f5e0db7008..f8b07d043cbfc151cff52caccafa87301e8a16f7 100644 (file)
@@ -903,7 +903,7 @@ st_entry_class_init (StEntryClass *klass)
                          "Primary Icon",
                          "Primary Icon actor",
                          CLUTTER_TYPE_ACTOR,
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StEntry:secondary-icon:
@@ -915,7 +915,7 @@ st_entry_class_init (StEntryClass *klass)
                          "Secondary Icon",
                          "Secondary Icon actor",
                          CLUTTER_TYPE_ACTOR,
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StEntry:hint-text:
@@ -929,7 +929,7 @@ st_entry_class_init (StEntryClass *klass)
                          "Text to display when the entry is not focused "
                          "and the text property is empty",
                          NULL,
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StEntry:hint-actor:
@@ -943,7 +943,7 @@ st_entry_class_init (StEntryClass *klass)
                          "An actor to display when the entry is not focused "
                          "and the text property is empty",
                          CLUTTER_TYPE_ACTOR,
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StEntry:text:
@@ -955,7 +955,7 @@ st_entry_class_init (StEntryClass *klass)
                          "Text",
                          "Text of the entry",
                          NULL,
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StEntry:input-purpose:
@@ -969,7 +969,7 @@ st_entry_class_init (StEntryClass *klass)
                        "Purpose of the text field",
                        CLUTTER_TYPE_INPUT_CONTENT_PURPOSE,
                        CLUTTER_INPUT_CONTENT_PURPOSE_NORMAL,
-                       ST_PARAM_READWRITE);
+                       ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StEntry:input-hints:
@@ -984,7 +984,7 @@ st_entry_class_init (StEntryClass *klass)
                         "Hints for the text field behaviour",
                         CLUTTER_TYPE_INPUT_CONTENT_HINT_FLAGS,
                         0,
-                        ST_PARAM_READWRITE);
+                        ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   g_object_class_install_properties (gobject_class, N_PROPS, props);
 
index 876aa9bbbf8731184ccc12f4ac3e89ab16b6dc94..f7586b94718c1ce3157981f3ea9e28a4884e5cb6 100644 (file)
@@ -295,7 +295,7 @@ st_icon_class_init (StIconClass *klass)
                          "GIcon",
                          "The GIcon shown by this icon actor",
                          G_TYPE_ICON,
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StIcon:fallback-gicon:
@@ -307,7 +307,7 @@ st_icon_class_init (StIconClass *klass)
                          "Fallback GIcon",
                          "The fallback GIcon shown if the normal icon fails to load",
                          G_TYPE_ICON,
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StIcon:icon-name:
@@ -319,7 +319,7 @@ st_icon_class_init (StIconClass *klass)
                          "Icon name",
                          "An icon name",
                          NULL,
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StIcon:icon-size:
@@ -332,7 +332,7 @@ st_icon_class_init (StIconClass *klass)
                       "Icon size",
                       "The size if the icon, if positive. Otherwise the size will be derived from the current style",
                       -1, G_MAXINT, -1,
-                      ST_PARAM_READWRITE);
+                      ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StIcon:fallback-icon-name:
@@ -345,7 +345,7 @@ st_icon_class_init (StIconClass *klass)
                          "Fallback icon name",
                          "A fallback icon name",
                          NULL,
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   g_object_class_install_properties (object_class, N_PROPS, props);
 }
index 54f16b155094dc28ade024d90530f0b9c9473f4b..b4dd8cd56ca9120d11f578c0710f72cb04c400ef 100644 (file)
@@ -296,7 +296,7 @@ st_label_class_init (StLabelClass *klass)
                            "Text",
                            "Text of the label",
                            NULL,
-                           ST_PARAM_READWRITE);
+                           ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   g_object_class_install_properties (gobject_class, N_PROPS, props);
 }
index 89eef42452121eb5e90b1b3f861c726a274f989a..43f9b5209faa956d810fd7453aa2bc50c8b8401a 100644 (file)
@@ -155,7 +155,7 @@ st_password_entry_class_init (StPasswordEntryClass *klass)
                                                        "Password visible",
                                                        "Whether the text in the entry is masked or not",
                                                        FALSE,
-                                                       ST_PARAM_READWRITE);
+                                                       ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StPasswordEntry:show-peek-icon:
@@ -167,7 +167,7 @@ st_password_entry_class_init (StPasswordEntryClass *klass)
                                                      "Show peek icon",
                                                      "Whether to show the password peek icon",
                                                      TRUE,
-                                                     ST_PARAM_READWRITE);
+                                                     ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   g_object_class_install_properties (gobject_class, N_PROPS, props);
 }
index 19fe26b5dc0b62247f647bd7e2966d13f39d2f91..72bcd55540281dea0b03afeabad8f508f2474de6 100644 (file)
@@ -534,7 +534,7 @@ st_scroll_bar_class_init (StScrollBarClass *klass)
   props[PROP_ADJUSTMENT] =
     g_param_spec_object ("adjustment", "Adjustment", "The adjustment",
                          ST_TYPE_ADJUSTMENT,
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StScrollBar:vertical:
@@ -546,7 +546,7 @@ st_scroll_bar_class_init (StScrollBarClass *klass)
                           "Vertical Orientation",
                           "Vertical Orientation",
                           FALSE,
-                          ST_PARAM_READWRITE);
+                          ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   g_object_class_install_properties (object_class, N_PROPS, props);
 
index 7dba2df42e19ede002f17cfad570ccfae90be35d..4cf45af1f20334817fdad9962dc68be7dc6cede8 100644 (file)
@@ -415,7 +415,7 @@ st_scroll_view_fade_class_init (StScrollViewFadeClass *klass)
                         "Fade margins",
                         "The margin widths that are faded",
                         CLUTTER_TYPE_MARGIN,
-                        ST_PARAM_READWRITE);
+                        ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StScrollViewFade:fade-edges:
@@ -427,7 +427,7 @@ st_scroll_view_fade_class_init (StScrollViewFadeClass *klass)
                           "Fade Edges",
                           "Whether the faded area should extend to the edges",
                           FALSE,
-                          ST_PARAM_READWRITE);
+                          ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StScrollViewFade:extend-fade-area:
@@ -439,7 +439,7 @@ st_scroll_view_fade_class_init (StScrollViewFadeClass *klass)
                           "Extend Fade Area",
                           "Whether faded edges should extend beyond the faded area",
                           FALSE,
-                          ST_PARAM_READWRITE);
+                          ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   g_object_class_install_properties (gobject_class, N_PROPS, props);
 }
index 45354244996fa8947e02d2f174042af471854d42..949d7994c667a8a22b656b27cd1ea6e507e7832d 100644 (file)
@@ -898,7 +898,7 @@ st_scroll_view_class_init (StScrollViewClass *klass)
                        "When the vertical scrollbar is displayed",
                        ST_TYPE_POLICY_TYPE,
                        ST_POLICY_AUTOMATIC,
-                       ST_PARAM_READWRITE);
+                       ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StScrollView:hscrollbar-policy:
@@ -911,7 +911,7 @@ st_scroll_view_class_init (StScrollViewClass *klass)
                        "When the horizontal scrollbar is displayed",
                        ST_TYPE_POLICY_TYPE,
                        ST_POLICY_AUTOMATIC,
-                       ST_PARAM_READWRITE);
+                       ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StScrollView:hscrollbar-visible:
@@ -947,7 +947,7 @@ st_scroll_view_class_init (StScrollViewClass *klass)
                           "Enable Mouse Scrolling",
                           "Enable automatic mouse wheel scrolling",
                           TRUE,
-                          ST_PARAM_READWRITE);
+                          ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StScrollView:overlay-scrollbars:
@@ -959,14 +959,14 @@ st_scroll_view_class_init (StScrollViewClass *klass)
                           "Use Overlay Scrollbars",
                           "Overlay scrollbars over the content",
                           FALSE,
-                          ST_PARAM_READWRITE);
+                          ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   props[PROP_CONTENT_PADDING] =
     g_param_spec_boxed ("content-padding",
                         "Content padding",
                         "Content padding",
                         CLUTTER_TYPE_MARGIN,
-                        ST_PARAM_READWRITE);
+                        ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   g_object_class_install_properties (object_class, N_PROPS, props);
 }
index aa387b9fd03c62fc1d1b3873296b4d3064d46a0d..3a77052dbc0d440143fe4742084c0a5051f40d31 100644 (file)
@@ -125,7 +125,7 @@ st_scrollable_default_init (StScrollableInterface *g_iface)
                                                                 "StAdjustment",
                                                                 "Horizontal adjustment",
                                                                 ST_TYPE_ADJUSTMENT,
-                                                                ST_PARAM_READWRITE));
+                                                                ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
 
       /**
        * StScrollable:vadjustment:
@@ -143,7 +143,7 @@ st_scrollable_default_init (StScrollableInterface *g_iface)
                                                                 "StAdjustment",
                                                                 "Vertical adjustment",
                                                                 ST_TYPE_ADJUSTMENT,
-                                                                ST_PARAM_READWRITE));
+                                                                ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
 
       initialized = TRUE;
     }
index 0edead615f8fd14e04fac984c0173b3c32e8c655..c7db08b9c658d779f9a06491fa670fa485b72807 100644 (file)
@@ -298,7 +298,7 @@ st_settings_class_init (StSettingsClass *klass)
                                                       "Slow down factor",
                                                       "Factor applied to all animation durations",
                                                       EPSILON, G_MAXDOUBLE, 1.0,
-                                                      ST_PARAM_READWRITE);
+                                                      ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StSettings:disable-show-password:
index 34cc4fac0c32a7b31e2776e1f5f6ee3888b98a14..4055786d629b2e19881fd0bda7e3f36c5be0c4b8 100644 (file)
@@ -142,7 +142,7 @@ st_theme_context_class_init (StThemeContextClass *klass)
                       "Scale factor",
                       "Integer scale factor used for HiDPI scaling",
                       0, G_MAXINT, 1,
-                      ST_PARAM_READWRITE);
+                      ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   g_object_class_install_properties (object_class, N_PROPS, props);
 
index e2814e52ea3940450d79fb9d412a73ae32615b7a..69bf86c5d94f06e65d7eb1f2312649d13e851081 100644 (file)
@@ -907,7 +907,7 @@ st_widget_class_init (StWidgetClass *klass)
                          "Pseudo Class",
                          "Pseudo class for styling",
                          "",
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StWidget:style-class:
@@ -919,7 +919,7 @@ st_widget_class_init (StWidgetClass *klass)
                          "Style Class",
                          "Style class for styling",
                          "",
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StWidget:style:
@@ -932,7 +932,7 @@ st_widget_class_init (StWidgetClass *klass)
                           "Style",
                           "Inline style string",
                           "",
-                          ST_PARAM_READWRITE);
+                          ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StWidget:track-hover:
@@ -948,7 +948,7 @@ st_widget_class_init (StWidgetClass *klass)
                            "Track hover",
                            "Determines whether the widget tracks hover state",
                            FALSE,
-                           ST_PARAM_READWRITE);
+                           ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StWidget:hover:
@@ -962,7 +962,7 @@ st_widget_class_init (StWidgetClass *klass)
                            "Hover",
                            "Whether the pointer is hovering over the widget",
                            FALSE,
-                           ST_PARAM_READWRITE);
+                           ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StWidget:can-focus:
@@ -974,7 +974,7 @@ st_widget_class_init (StWidgetClass *klass)
                            "Can focus",
                            "Whether the widget can be focused via keyboard navigation",
                            FALSE,
-                           ST_PARAM_READWRITE);
+                           ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StWidget:label-actor:
@@ -986,7 +986,7 @@ st_widget_class_init (StWidgetClass *klass)
                           "Label",
                           "Label that identifies this widget",
                           CLUTTER_TYPE_ACTOR,
-                          ST_PARAM_READWRITE);
+                          ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StWidget:accessible-role:
@@ -999,7 +999,7 @@ st_widget_class_init (StWidgetClass *klass)
                         "The accessible role of this object",
                         ATK_TYPE_ROLE,
                         ATK_ROLE_INVALID,
-                        ST_PARAM_READWRITE);
+                        ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StWidget:accessible-name:
@@ -1011,7 +1011,7 @@ st_widget_class_init (StWidgetClass *klass)
                           "Accessible name",
                           "Object instance's name for assistive technology access.",
                           NULL,
-                          ST_PARAM_READWRITE);
+                          ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   g_object_class_install_properties (gobject_class, N_PROPS, props);